package servlet.huwenyao;

import pojo.User;
import service.OrderService;
import service.impl.OrderServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * 新增时回显用户账号
 */
@WebServlet(value = "/InsertOrderEchoServlet2")
public class InsertOrderEchoServlet2 extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setCharacterEncoding("utf-8");
        request.setCharacterEncoding("UTF-8");
        //实例化service层
        OrderService o=new OrderServiceImpl();
        List<User> userList=new ArrayList<User>();
        userList=o.userList();
        request.setAttribute("userList",userList);
        request.getRequestDispatcher("jsp/hwy/InsePageOrder.jsp").forward(request,response);
    }
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
     doPost(request,response);
    }

}
